<template>
  <div id="client">
    <p style="margin-left: 20px">
      <span class="demonstration" style="margin-left: 20px">开票日期：</span>
      <el-date-picker
        v-model="value2"
        type="daterange"
        align="right"
        unlink-panels
        range-separator="至"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
        :picker-options="pickerOptions"
      >
      </el-date-picker>
      &nbsp;&nbsp;&nbsp;
      <span class="demonstration" style="margin-left: 20px">单据日期：</span>
      <el-date-picker
        v-model="value2"
        type="daterange"
        align="right"
        unlink-panels
        range-separator="至"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
        :picker-options="pickerOptions"
      >
      </el-date-picker>
      &nbsp;&nbsp;&nbsp; 单据编号：<el-input
        style="width: 180px; margin-left: 10px; margin-right: 20px"
        placeholder="单据编号"
        v-model="input"
        clearable
      >
      </el-input>
      &nbsp;&nbsp;&nbsp;
      <span
        style="
          display: inline-block;
          float: right;
          margin-right: 78px;
          margin-top: 20px;
          margin-bottom: 20px;
        "
      >
        <el-button>重置</el-button>
        <el-button>导出</el-button>
        <el-button type="danger">删除</el-button>
        <el-button type="primary">查询</el-button>
      </span>
    </p>
    <el-table
      height="400px"
      :data="tableData"
      border
      style="width: 100%; font-size: 13px"
    >
      <el-table-column type="selection" width="55"> </el-table-column>

      <el-table-column prop="opendate" label="开票日期" width="120">
      </el-table-column>
      <el-table-column prop="domoney" label="开票金额" width="120">
      </el-table-column>
      <el-table-column prop="thisId" label="发票号" width="120">
      </el-table-column>
      <el-table-column prop="head" label="发票抬头" width="120">
      </el-table-column>
      <el-table-column prop="date" label="单据日期" width="150">
      </el-table-column>
      <el-table-column prop="ordersId" label="单据编号" width="120">
      </el-table-column>
      <el-table-column prop="orderId" label="源销货订单号" width="120">
      </el-table-column>
      <el-table-column prop="client" label="客户" width="120">
      </el-table-column>
      <el-table-column prop="doman" label="制单人" width="120">
      </el-table-column>
      <el-table-column prop="dodate" label="制单日期" width="120">
      </el-table-column>
      <el-table-column prop="totalmoney" label="金额" width="120">
      </el-table-column>
      <el-table-column prop="tax" label="税率" width="120"> </el-table-column>
      <el-table-column prop="taxmoney" label="价税合计" width="120">
      </el-table-column>
      <el-table-column prop="sellman" label="销售人员" width="120">
      </el-table-column>
      <el-table-column prop="getMoney" label="已收款" width="120">
      </el-table-column>
      <el-table-column prop="getMoneystatus" label="收款状态" width="120">
      </el-table-column>
      <el-table-column prop="piaoMoney" label="开票金额" width="120">
      </el-table-column>
      <el-table-column prop="mytext" label="备注" width="120">
      </el-table-column>
      <el-table-column fixed="right" label="操作" width="100">
        <template slot-scope="scope">
          <el-button @click="handleClick(scope.row)" type="text" size="small"
            >查看</el-button
          >
          <el-button type="text" size="small">编辑</el-button>
        </template>
      </el-table-column>
    </el-table>
    <div style="width: 100%; background-color: blanchedalmond; height: 30px">
      <table style="width: 78.7%; height: 30px">
        <tr>
          <td style="width: 50%">合计：</td>
          <td style="width: 50%">123</td>
        </tr>
      </table>
    </div>
    <el-pagination
      style="position: relative; left: 700px; top: 10px; right: 50px"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="currentPage4"
      :page-sizes="[100, 200, 300, 400]"
      :page-size="100"
      layout="total, sizes, prev, pager, next, jumper"
      :total="400"
    >
    </el-pagination>
    <el-dialog top="20px" title="新增客户" :visible.sync="dialogFormVisible">
      <AddClient />
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogFormVisible = false"
          >确 定</el-button
        >
      </div>
    </el-dialog>
    <div style="height: 20px; clear: both"></div>
    <el-dialog top="20px" title="添加发票" :visible.sync="dialogFormVisible">
      <el-input
        v-model="input"
        placeholder="请输入编号或名称"
        style="width: 200px; margin-left: 20px"
      ></el-input>
      <el-checkbox v-model="checked" style="margin-left: 20px"
        >显示禁用职员</el-checkbox
      >
      <el-button type="success" style="margin-left: 20px">查询</el-button>
      <el-table :data="gridData">
        <el-table-column type="selection" width="55"> </el-table-column>
        <el-table-column
          width="100"
          property="name"
          label="类别"
        ></el-table-column>
        <el-table-column
          width="100"
          property="address"
          label="编号"
        ></el-table-column>
        <el-table-column
          width="300"
          property="address"
          label="名称"
        ></el-table-column>
        <el-table-column
          width="100"
          property="address"
          label="联系人"
        ></el-table-column>
        <el-table-column
          width="100"
          property="address"
          label="手机"
        ></el-table-column>
        <el-table-column
          width="100"
          property="address"
          label="备注"
        ></el-table-column>
      </el-table>
      <div class="block">
        <span class="demonstration"></span>
        <el-pagination layout="prev, pager, next" :total="1000">
        </el-pagination>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogFormVisible = false"
          >确 定</el-button
        >
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: "InvoicingList",
  data() {
    return {
      goto(to) {
        if (this.$route.path !== "/" + to) {
          this.$router.push(to);
        }
      },
      dialogFormVisible: false,
      gridData: [
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
      ],
      tableData: [
        {
          opendate: "2024-01-01",
          domoney: 1000,
          thisId: "发票001",
          head: "公司A",
          date: "2024-01-01",
          ordersId: "单据001",
          orderId: "源销货001",
          client: "客户A",
          doman: "张三",
          dodate: "2024-01-01",
          totalmoney: 1200,
          tax: 0.13,
          taxmoney: 1300,
          sellman: "销售员A",
          getMoney: 500,
          getMoneystatus: "部分收款",
          piaoMoney: 1000,
          mytext: "无特殊要求",
        },
        {
          opendate: "2024-01-02",
          domoney: 1500,
          thisId: "发票002",
          head: "公司B",
          date: "2024-01-02",
          ordersId: "单据002",
          orderId: "源销货002",
          client: "客户B",
          doman: "李四",
          dodate: "2024-01-02",
          totalmoney: 1800,
          tax: 0.13,
          taxmoney: 1950,
          sellman: "销售员B",
          getMoney: 1000,
          getMoneystatus: "全部收款",
          piaoMoney: 1500,
          mytext: "加急处理",
        },
        {
          opendate: "2024-01-03",
          domoney: 800,
          thisId: "发票003",
          head: "公司C",
          date: "2024-01-03",
          ordersId: "单据003",
          orderId: "源销货003",
          client: "客户C",
          doman: "王五",
          dodate: "2024-01-03",
          totalmoney: 950,
          tax: 0.13,
          taxmoney: 1075,
          sellman: "销售员C",
          getMoney: 300,
          getMoneystatus: "部分收款",
          piaoMoney: 800,
          mytext: "注意包装",
        },
        {
          opendate: "2024-01-04",
          domoney: 1200,
          thisId: "发票004",
          head: "公司D",
          date: "2024-01-04",
          ordersId: "单据004",
          orderId: "源销货004",
          client: "客户D",
          doman: "赵六",
          dodate: "2024-01-04",
          totalmoney: 1400,
          tax: 0.13,
          taxmoney: 1560,
          sellman: "销售员D",
          getMoney: 700,
          getMoneystatus: "部分收款",
          piaoMoney: 1200,
          mytext: "需开发票",
        },
        {
          opendate: "2024-01-05",
          domoney: 1800,
          thisId: "发票005",
          head: "公司E",
          date: "2024-01-05",
          ordersId: "单据005",
          orderId: "源销货005",
          client: "客户E",
          doman: "钱七",
          dodate: "2024-01-05",
          totalmoney: 2200,
          tax: 0.13,
          taxmoney: 2600,
          sellman: "销售员E",
          getMoney: 1500,
          getMoneystatus: "全部收款",
          piaoMoney: 1800,
          mytext: "节假日顺延",
        },
      ],
      value2: "",
    };
  },
  methods: {
    goto(to) {
      this.$router.push(to);
    },
  },
};
</script>

<style scoped>
.el-button el-button--default el-popover__reference {
  margin-right: 20px;
}

tr {
  border: 1px solid black;
}
</style>